﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace XNAGame_Lab1
{
    public class Store :MyXNAButton
    {
        List<MyXNAStore> _ListZoombie;

        public List<MyXNAStore> ListZoombie
        {
            get { return _ListZoombie; }
            set { _ListZoombie = value; }
        }
        
        public Store()
        {

            _ListZoombie = new List<MyXNAStore>();
        }
        public void Add(MyXNAStore MyXNAStore)
        {
            _ListZoombie.Add(MyXNAStore);
            
            MyXNAStore.Clicked += new EventHandler(MyXNAStore_ProduceFoodComplete);
            MyXNAStore.OnPress += new EventHandler(MyXNAStore_OnPress);
        }

        void MyXNAStore_OnPress(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            

        }

        void MyXNAStore_ProduceFoodComplete(object sender, EventArgs e)
        {
         
            //if (btn11.Cost < sun.Cost)
            //{
            //    sun.Cost -= btn11.Cost;
            //    //                                    sun.Update(gameTime);

            //    //mapcell.Cell[i, j] = new Cell(Content, "Khungbaocomau00", mapcell.Cell[i, j].TopLeft, mapcell.Cell[i, j].Size);
            //    //   mapcell.Cell[i, j].Update(gameTime);
            //    button.Add(btn11);
            ////}

        }
        public override void Update(GameTime gameTime)
        {
            for (int i = 0; i < _ListZoombie.Count; i++)
                _ListZoombie[i].Update(gameTime);
        }
        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            for (int i = 0; i < _ListZoombie.Count; i++)
                _ListZoombie[i].Draw(gameTime, spriteBatch);
        }
    }
}
